package com.zsk.mybaits.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.ImportResource;

/**
 * https://www.jianshu.com/p/523796ffdc8a
 * <p>
 * AbstractPlatformTransactionManager 365 line 创建事务代码
 * TransactionAspectSupport.java 649 line      异常回滚事务代码
 *
 * @author: keke
 * @date: 2021/8/7 23:50
 */
// 取消spring-data 自动配置
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
// 导入spring xml 配置文件,支持多个
@ImportResource(locations = {"classpath:dataSourceConfig.xml"})
public class MybatisXmlApplication {
    public static void main(String[] args) {
        SpringApplication.run(MybatisXmlApplication.class, args);
    }
}
